/*
* IBM Confidential
* (C) Copyright IBM Corp. 2011 All Rights Reserved.
*/
package com.ibm.crm.tma.adapter.mq.testplan;

import com.ibm.crm.tma.adapter.mq.testplan.dto.Plan;

/**
 * <p>
 * This interface is the contract for executing a test plan.
 * (i.e. execute the passed-in operation repetitively using the 
 * configuration specified in the passed-in plan instance).
 * It provides a single method which executes a test plan using
 * the specified TestOperation instance.
 * </p>
 * <p>
 * Thread Safety:
 * Implementations of this interface are required to be thread safe.
 * </p>
 * @author Schpotsky, TCSDEVELOPER
 * @version 1.0
 */
public interface PlanExecuter {
    /**
     * <p>
     * This method is the contract for executing a test plan.
     * It executes the passed-in operation in repetitive manner
     * using the configuration specified by the passed-in plan instance.
     * </p>
     * @param operation
     *            The TestOperation to be executed repetitively using
     *            the configuration specified in the plan instance.
     * @param plan
     *            The Plan instance representing the test plan to be executed.
     *            (contains the configuration of the test plan execution
     *            : total number of operations,
     *            duration and peaks configuration).
     * @throws PlanExecuterException
     *             If any other error occurred when executing the test plan.
     * @throws IllegalArgumentException
     *             If plan or operation is null.
     */
    void execute(final Plan plan, final TestOperation operation)
            throws PlanExecuterException;
}

